import requests from "./requests";

//获取历史记录
export const getHistory = () => {
    return requests({
      url: "/api/getHistory",
    });
  };
  //添加到历史记录中
  export const addHistory = (bookId) => {
    return requests({
      method: "POST",
      url: "/api/addHistory",
      data: {
        bookId,
      },
    });
  };
  //清空历史记录
  export const cleanAllHistory = () => {
    return requests({
      method: "DELETE",
      url: "/api/deleteAllHistory",
    });
  };
  //删除单个历史记录
  export const cleanHistory = (id) => {
    return requests({
      method: "DELETE",
      url: "/api/deleteHistory",
      data: {
        id,
      },
    });
  };
  